<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>文本编辑</title>
	<script src="../static/js/save_h5.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>

<div id="see">
    <h1>文章内容</h1>
	<p>
		标题：<input type="text" value={{request.POST.title|safe}} readonly='true'>
	</p>
	<p>

			{{ request.POST.content|safe }}
		
		
		
	</p>
	
    
</div>


<form method="POST">
    <h1>请输入内容：</h1>
    {% csrf_token %}
	<p>请输入标题：<input type="text" name="title" id="title" value="" /></p>
    <div style="width: 100%; margin: 0 auto;">
        <textarea name="content" id="content"></textarea>
    </div>
    <input type="submit" value="提交"/>
</form>

<button type="button" onclick="saveh5()">保存</button>
<script src="/static/js/jquery-3.4.1.js"></script>
<script src="/static/kindeditor/kindeditor-all.js"></script>
<script>
    $(function () {
        initKindEditor();
    });

    function initKindEditor() {
        var a = 'kind';
        var kind = KindEditor.create('#content', {
            width: '100%',       // 文本框宽度(可以百分比或像素)
            height: '300px',     // 文本框高度(只能像素)
            minWidth: 200,       // 最小宽度（数字）
            minHeight: 400,      // 最小高度（数字）
            uploadJson: '/upload_img/',
			
            extraFileUploadParams: {
                'csrfmiddlewaretoken': '{{ csrf_token }}'
            },
			filterMode: true,
            fileManagerJson: '/file_manager/',
            allowPreviewEmoticons: true,
            allowImageUpload: true,
			allowFileManager: true,
			filePostName:'post_img'
        });
    }
</script>
</body>
</html>
